<div id="main">
  <h2><%= t('h2.articles') %></h2>
  <%= render :partial => "search" %>
  <%= will_paginate @articles %>
  <div class="btn_t btn_add">
    <input type="button" class="btn_s" value="<%= t('labels.new') %>" 
           onclick="location.href='<%= new_admin_article_url %> '"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </div>
  <br class="clear"/>
  <table class="data2 order-table">
    <tr>
      <th><%= order_by_link :id,:text=>"ID"%></th>
      <th><%= order_by_link :title, :text => Article.human_attribute_name("title") %></th>
      <th><%= order_by_link :category_id, :text => Article.human_attribute_name("category_id") %></th>
      <th width="15%"><%= order_by_link :created_at, :text => t("labels.created_at") %></th>
      <th width="12%"><%=  t('labels.operation') %></th>
    </tr>
    <% @articles.each do |article| %>
      <tr class="<%= cycle("", "even") %>">
        <td><%= article.id %></td>
        <td><%= article.title %></td>
        <td><%= article.category.name %></td>
        <td><%= parse_date article.created_at %></td>
        <td>
          <%= link_to t('labels.edit'), edit_admin_article_path(article) %><br/>
          <%= link_to t('labels.delete'), admin_article_path(article), :confirm => "are your sure?", :method => :delete %><br/>
        </td>
      </tr>
    <% end %>
  </table>
  
  <%= will_paginate @articles %>
  
</div>
